package com.ncloud.product.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface PriceItemMapper{

	@Select("select distinct price_id from bs_p_price_item where prod_id=#{prodId} and discnt_id = #{discntId} and item_code=#{itemCode}"
			+ " and case item_type when 'S' then option_id=#{value} else #{value}+0 between min_value and max_value end"
			+ " and now() between begin_date and end_date")
//	@Results({@Result(column="price_item_id",property="priceItemId"),@Result(column="prod_id",property="prodId"),
//		@Result(column="price_id",property="priceId"),@Result(column="item_code",property="itemCode"),
//		@Result(column="item_type",property="itemType"),@Result(column="option_id",property="optionId"),
//		@Result(column="min_value",property="minValue"),@Result(column="max_value",property="maxValue"),
//		@Result(column="begin_date",property="beginDate"),@Result(column="end_date",property="endDate")})
	List<Long> getPriceByItem(@Param("prodId")Long prodId, @Param("discntId")Long discntId,
			@Param("itemCode")String itemCode, @Param("value")String value);

}
